public class java004 {
    public static void main(String[] args){
        for(int i=10;i<100000;i++){
         int a=i;
         int b=0;
            while (i > 0) {
                int c = i % 10;
                b = b * 10 + c;
                i = i / 10;
            }

            if( a == b){
                System.out.println(a);
            }
            i=a;

        }
    }
}
